#!bin/bash
seconds_left=3
echo "正在检测你是否安装过本脚本包含的服务……"
while [ $seconds_left -gt 0 ];do
	echo -n $seconds_left
	sleep 1
		seconds_left=$(($seconds_left - 1))
	echo -ne "\r     \r" #清除本行文字
	done	
	
	
rpmd=$(rpm -qa | grep vsftpd)
if [ -z "$rpmd" ]; then
        echo
	else
	  echo -e "\033[31m --------------你已安装FTP服务-----------------\033[0m"
fi
########--------------------------------------docker检测--------------------------------------##
rpmd=$(rpm -qa | grep docker)
if [ -z "$rpmd" ]; then
	   echo
	else
	  echo -e "\033[31m --------------你已安装docker服务-----------------\033[0m"
fi
#####--------------------------------------httpd检测------------------------------------------##
rpmh=$(rpm -qa | grep http)
if [ -z "$rpmh" ]; then
        echo
else
     echo -e "\033[31m --------------你已安装HTTP服务-----------------\033[0m"	
fi
#####--------------------------------------数据库检测------------------------------------------##
rpmm=$(rpm -qa | grep mariadb)
if [ -z "$rpmm" ]; then
	echo   
else
	echo -e "\033[31m --------------你已安装数据库服务-----------------\033[0m"
fi
#####-------------------------------------- phpMyAdmin检测------------------------------------------##
rpmm=$(rpm -qa | grep phpMyAdmin)
if [ -z "$rpmm" ]; then
	echo   
else
	echo -e "\033[31m --------------你已安装phpMyAdmin服务-----------------\033[0m"
fi

echo 如果显示空白，则你的服务器未安装本脚本的服务
echo 是否返回主菜单？y/n
read main
if [ $main == y ];then
	sh configure/main.sh
else
	echo 感谢使用
	rm -rf shellall
fi
